package com.orphan.audit.dao;

import com.orphan.audit.po.Supplier;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>p
 *
 * @author yichen
 * @since 2021-07-14
 */
@Repository("supplierMapper")
public interface SupplierMapper extends BaseMapper<Supplier> {
    /**
     * 获取供应商注册消息
     * @return
     */
    @Select("select * from t_supplier")
    List<Supplier>getAll();

    @Update("update t_supplier t set t.status=#{status},t.rank=#{rank} where id=#{id}")
    int Update(Supplier supplier);

    @Insert(" insert into t_supplier (id,username,password,gender,tel,idpic,brand,status,licensepic)" +
            " values (null,#{username},#{password},#{gender},#{tel},#{idpic},#{brand},#{status},#{licensepic})")
    int add(Supplier supplier);

}
